{{extends file="admin/admin_header.tpl"}}
{{block name="content"}}
{{if empty($content)}}
<form action="{{site_url("document/Sort?CateId={{$Pid}}&data=article")}}" method="post">
<h3>内容管理
	<div class="pull-right">
		<a href="{{site_url("$url")}}" class="btn btn-sm btn-success">
			添加新内容
		</a>
	</div>
</h3>

<div class="col-sm-3 content-sidebar">
{{include file="admin/tree.tpl"}}
</div>
<div class="col-sm-9 content-main">
	<p>
		<span class="current-column">
			当前栏目:{{$cateNow.0.CateName}}
		</span>
		<button type="submit" class="btn btn-xs btn-success" style="margin-left:20px;">排序</button>
	</p>
	
	<div class="table-responsive">
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th style="width:5%;">排序</th>
					<th style="width:5%;">Id</th>
					<th style="width:50%;">标题</th>
					<th style="width:12%;">时间</th>
					<th style="width:12%;text-align: center;">操作</th>
				</tr>
			</thead>
			<tbody>
				{{foreach $data as $v}}
				<tr>
					<td style="text-align:center;">
						<input type="text" style="width:50px;height:20px;text-align:center;" name="{{$v.Id}}" value="{{$v.Sort}}">
					</td>
					<td>{{$v.Id}}</td>
					<td><p style="margin: 0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 450px;">{{$v.Title}}</p></td>
					<td>							{{if !empty($v.PubTime)}}
							{{date('Y-m-d',$v.PubTime)}}
							{{else}}
							{{date('Y-m-d',$v.Time)}}
							{{/if}}</td>
					<td style="text-align: center;width: 10%;">
						<a href="{{site_url("document/EditPage?Id={{$v.Id}}")}}" class="btn btn-xs btn-primary">编辑</a>
						<a href="javascript:void(0)" onclick="modal('{{site_url("document/Delete?Id={{$v.Id}}")}}')" class="btn btn-xs btn-danger">删除</a>
					</td>
				</tr>
				{{/foreach}}
			</tbody>
		</table>
	</div>
	{{include file="admin/page.tpl"}}
</div>
</form>
{{else}}
<h3>内容管理
</h3>
<div class="col-sm-3 content-sidebar">
{{include file="admin/tree.tpl"}}
</div>
	<div>
		<h1 style="min-height: 500px;text-align: center;margin-top: 50px;">{{$content}}</h1>
	</div>
{{/if}}
{{/block}}